package com.jmb.api.common.enumPro;

/**
 * 用例等级枚举
 */
public enum CaseLevel {

    HIGH("高", 0),
    MID("中", 1),
    LOW("低", 2),

    HIGH_("0", 0),
    MID_("1", 1),
    LOW_("2", 2);

    private final String levelName;
    private final Integer levelNum;

    CaseLevel(String levelName, Integer levelNum) {
        this.levelName = levelName;
        this.levelNum = levelNum;
    }

    public static Integer getLevelKey(String levelName) {
        for(CaseLevel caseLevel : CaseLevel.values()) {
            if (caseLevel.levelName.equalsIgnoreCase(levelName)) {
                return caseLevel.levelNum;
            }
        }
        return 0; //默认等级为0
    }

}
